package com.maomao.holding;

/**
 *
 * @author admin
 * @date 2018/4/3
 */
public class Client implements Comparable<Client> {

    private String name;
    private int age;

    public Client() {
        super();
    }

    public Client(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public int compareTo(Client o) {
//        return name.compareTo(o.getName());
        return age-o.getAge();
    }

    @Override
    public String toString() {
        return "Client{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
